package com.mjk.common.ai.work.chat;


import com.mjk.common.ai.dto.DrawDto;
import com.mjk.common.ai.dto.DrawListResp;
import com.mjk.common.ai.service.DrawService;
import jakarta.annotation.Resource;
import jakarta.validation.constraints.NotBlank;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/draw/star")
@Validated
public class DrawStarController {

    @Resource
    private DrawService drawService;

    @GetMapping("/mine")
    public DrawListResp myStars(@RequestParam Long maxId, @RequestParam int pageSize) {
        return drawService.listStarred(maxId, pageSize);
    }

    @PostMapping("/toggle/{uuid}")
    public DrawDto star(@PathVariable @NotBlank String uuid) {
        return drawService.toggleStar(uuid);
    }
}
